#!/bin/sh
#
# Send email to the tintin++ development team: use this for
# bug reports, questions, pleas for help, or anything, really.
#

# Our email address -- hopefully this won't change too soon.
DEVTEAM=ranger_space@hotmail.com

# Warnings about non-distribution versions.
WARNING='NOTE!!  This is a *development* version, so may be very buggy!
'
SUBJECT='A tintin++ gripe (DEV)'
# WARNING=''
# SUBJECT='A tintin++ gripe'

TMP=/tmp/gripe.$$
FORMFEED=""

cat <<EOF
Please type your question, complaint, or comment now.
To send your message, type control-D alone on a line
after you are finished.

What you type now will be emailed to the development team;
so please read the documentation BEFORE mailing us!

Please type control-C now if you don't want to send us any email.
Don't spam us with unnecessary email.. please...
$WARNING
EOF

cat - >$TMP

echo 'Are you sure you want to send this message?'
read yesno
case "$yesno" in
y*|Y*)	;;
*)	echo Ok, not sending.; exit 1;;
esac

# Get some extra information the sender might forget to include.

echo " "		>>$TMP
echo "$FORMFEED"	>>$TMP
echo " "		>>$TMP
echo "This is a program-generated gripe.  Output follows:"	>>$TMP
echo " "		>>$TMP
uname -a		>>$TMP
echo "$FORMFEED"	>>$TMP
grep VERSION tintin.h	>>$TMP
echo "$FORMFEED"	>>$TMP
cat /etc/motd		>>$TMP
echo "$FORMFEED"	>>$TMP
ls -C			>>$TMP
echo "$FORMFEED"	>>$TMP
# Just send the configurable section of the Makefile
cat Makefile		>>$TMP

# Send the email and be done with it already!

mail -s "$SUBJECT" $DEVTEAM <$TMP
rm -f $TMP

cat <<EOF

We'll try to answer your email as soon as possible.
-- The tintin++ development team.
EOF

exit 0
